<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>商城首页</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" type="text/css" />
	<script src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap.min.js" type="text/javascript"></script>
</head>

<body>
<div class="container-fluid">
	<jsp:include page="header.jsp"/>
	<!--
        描述：商品显示
    -->
	<div class="container-fluid" >
		<div class="col-md-10" id="hotProductList">
		</div>
	</div>
	<script type="application/javascript">
		$.ajax({
			url:"/cbp/product/pageBuyer/1/10/1",
			type:"get",
			dataType: "json",
			success:function (json) {
				for(var i = 0 ;i < json.data.list.length;i++){
					var product = json.data.list[i];
					var divNode = "<div class=\"col-md-2\" style=\"text-align:center;height:200px;padding:10px 0px;\">\n" +
							"\t\t\t\t\t\t<a href=\"${pageContext.request.contextPath}/productInfo/"+product.productId+"\">\n" +
							"\t\t\t\t\t\t\t<img src=\"${pageContext.request.contextPath}/static/work/Tomcat/localhost/ROOT/"+product.pimage +"\" width=\"130\" height=\"130\" style=\"display: inline-block;\">\n" +
							"\t\t\t\t\t\t</a>\n" +
							"\t\t\t\t\t\t<p><a href=\"${pageContext.request.contextPath}/productInfo/"+product.productId+"\" style='color:#666;width:150px;height:20px;display:block;overflow:hidden;margin-left:10px;'>" +product.productName+ "</a></p>\n" +
							"\t\t\t\t\t\t<p><font color=\"#E4393C\" style=\"font-size:16px\">&yen;"+ product.productPrice +"</font></p>\n" +
							"\t\t\t\t\t</div>";

					//追加
					$("#hotProductList").append(divNode);
				}
			}
		})
	</script>
	<!--
        描述：页脚部分
    -->
	<div class="container-fluid">
		<div style="margin-top:50px;">
			<img src="${pageContext.request.contextPath}/img/footer.jpg" width="100%" height="78" alt="我们的优势" title="我们的优势" />
		</div>
		<div style="text-align: center;margin-top: 5px;">
			<ul class="list-inline">
				<li><a>关于我们</a></li>
				<li><a>联系我们</a></li>
				<li><a>招贤纳士</a></li>
				<li><a>法律声明</a></li>
				<li><a>友情链接</a></li>
				<li><a>支付方式</a></li>
				<li><a>配送方式</a></li>
				<li><a>服务声明</a></li>
				<li><a>广告声明</a></li>
			</ul>
		</div>
		<div style="text-align: center;margin-top: 5px;margin-bottom:20px;">
			Copyright &copy; 2005-2016 材搬配建材商城 版权所有
		</div>
	</div>
</div>
</body>

</html>
